import { useMainStore } from '@/store'

const titles: DeepReadonly<Title[]> = [
  // * 混凝土
  {
    type: '混凝土结构-碳化深度检测记录表',
    columns: [
      {
        name: '记录编号',
        prop: 'jlbh',
        echo: true,
      },
      {
        name: '检测日期',
        prop: 'jcrq',
      },
      {
        name: '天气',
        prop: 'tq',
        echo: true
      },
      {
        name: '检测依据',
        prop: 'jcyj',
        echo: true
      },
      {
        name: '判定依据',
        prop: 'pdyj',
        echo: true
      },
      {
        name: '主要仪器设备名称及编号',
        prop: 'yqsb',
        echo: true
      },
      {
        name: '构件编号',
        prop: 'gjbh',
        echo: true,
      },
      {
        name: '碳化深度测区1',
        prop: 'cq1',
      },
      {
        name: '碳化深度实测值1',
        prop: 'scz1',
      },
      {
        name: '碳化深度实测值2',
        prop: 'scz2',
      },
      {
        name: '碳化深度实测值3',
        prop: 'scz3',
      },
      {
        name: '碳化深度平均值1',
        prop: 'pjz1',
      },
      {
        name: '碳化深度测区2',
        prop: 'cq2',
      },
      {
        name: '碳化深度实测值4',
        prop: 'scz4',
      },
      {
        name: '碳化深度实测值5',
        prop: 'scz5',
      },
      {
        name: '碳化深度实测值6',
        prop: 'scz6',
      },
      {
        name: '碳化深度平均值2',
        prop: 'pjz2',
      },
      {
        name: '碳化深度测区3',
        prop: 'cq3',
      },
      {
        name: '碳化深度实测值7',
        prop: 'scz7',
      },
      {
        name: '碳化深度实测值8',
        prop: 'scz8',
      },
      {
        name: '碳化深度实测值9',
        prop: 'scz9',
      },
      {
        name: '碳化深度平均值3',
        prop: 'pjz3',
      },
      {
        name: '碳化深度平均值',
        prop: 'pjz',
      },
      {
        name: '说明示意图',
        prop: 'smsyt',
      },
      {
        name: '检测',
        prop: 'jc',
        echo: true
      },
      {
        name: '记录',
        prop: 'jl',
        echo: true
      },
      {
        name: '复核',
        prop: 'fh',
        echo: true
      },
      {
        name: '日期',
        prop: 'rq',
        echo: true
      }
    ]
  },
  {
    type: '混凝土结构-钢筋位置（电磁感应法）',
    columns: [
      {
        name: '记录编号',
        prop: 'jlbh',
        echo: true
      },
      {
        name: '检测日期',
        prop: 'jcrq',
      },
      {
        name: '检测条件',
        prop: 'jctj',
        echo: true
      },
      {
        name: '检测依据',
        prop: 'jcyj',
        echo: true
      },
      {
        name: '判定依据',
        prop: 'pdyj',
        echo: true
      },
      {
        name: '主要仪器设备名称及编号',
        prop: 'yqsb',
        echo: true
      },
      {
        name: '构件名称及编号',
        prop: 'gjmcjbh',
        echo: true
      },
      {
        name: '钢筋类型',
        prop: 'gjlx'
      },
      {
        name: '检测位置',
        prop: 'jcwz'
      },
      {
        name: '设计值(mm)',
        prop: 'sjz'
      },
      {
        name: '实测值(mm)1',
        prop: 'scz1'
      },
      {
        name: '实测值(mm)2',
        prop: 'scz2'
      },
      {
        name: '实测值(mm)3',
        prop: 'scz3'
      },
      {
        name: '实测值(mm)4',
        prop: 'scz4'
      },
      {
        name: '实测值(mm)5',
        prop: 'scz5'
      },
      {
        name: '实测值(mm)6',
        prop: 'scz6'
      },
      {
        name: '说明',
        prop: 'sm',
        echo: true
      },
      {
        name: '检测',
        prop: 'jc',
        echo: true
      },
      {
        name: '记录',
        prop: 'jl',
        echo: true
      },
      {
        name: '复核',
        prop: 'fh',
        echo: true
      },
      {
        name: '日期',
        prop: 'rq',
        echo: true
      }
    ]
  }
]

export const getTitlesByType = () => {
  const mainStore = useMainStore()
  const t = mainStore.getCurType()
  return titles.find((item) => item.type === t)?.columns
}
